using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using LESLogica;

public partial class editarEvento : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.TabContainer1.ActiveTabIndex = 1;
        if ((Session["eventoParaEditar"] != null) && ((bool)(Session["eventoParaEditar"])))
        {
            Session["eventoParaEditar"] = null;
            int idEvento = (int)(Session["idEvento"]);
            FacadeService fachada = new FacadeService();
            SEvento evento = fachada.getEvento(idEvento);
            this.TextBoxNome.Text = evento.nome;
            this.TextBoxDescricao.Text = evento.descricao;
        }
    }
    protected void ButtonSalvarAlteracoes_Click(object sender, EventArgs e)
    {
        FacadeService service = new FacadeService();
        int idEvento = (int)(Session["idEvento"]);
        service.UpdateEvento(idEvento, this.TextBoxNome.Text, this.TextBoxDescricao.Text);
        this.LabelConfirmacao.Text = "Indicador atualizado com sucesso";
    }
}
